<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateCollegeCategoryTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('college_category', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('pid')->default(0)->comment('父id');
            $table->string('name', 20)->default('')->comment('分类名称');
            $table->unsignedInteger("sort")->default(0)->comment("排序，越小越靠前");
            $table->unsignedTinyInteger('isDeleted')->default(0)->comment("是否删除 0：未删除，1：已删除");

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '商学院 - 课程分类表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('college_category');
    }
}
